1. Field of the Invention
The present invention relates to an image processing device which corrects color shift of its own accord.
2. Description of the Related Art
A conventional image processing device will be described with reference to FIGS. 4-6.
FIG. 4 is an overall structural diagram of a conventional image processing device. A scanning unit 41 scans a paper and converts it into electric signals, thus generating scanning data. A color correction unit 42 corrects color shift in this scanning data or data which has been received. An image processing unit 43 implements .gamma. correction, or lightness correction, and binary processing on the data which has been corrected for color shift in this manner. A control unit 45 controls the whole process.
There follows a description of the action of a conventional image processing device of the above configuration. Colors are represented by the three primary colors R, G and B. Hardware within the image processing device processes all colors in terms of these three primary ones. Now, colors may also be expressed by means of color coordinates (*L*a*b), wherein lightness and chromaticity are separated. This means that in calculating color shift in order to determine correction coefficients, it is possible to do so by correcting only the chromaticity, and leaving the lightness uniform. However, inasmuch as the correction of color shift is applied to devices which process color in terms of R, G and B, it requires to be expressed in the R/G/B system. Thus, color differences are calculated in terms of *L*a*b coordinates, while correction coefficients are calculated in terms of R, G and B coordinates.
FIGS. 5 and 6 will be used in order to explain the flow up to the acquisition of an optimal color correction matrix. The control unit 45 converts a plurality of color pattern data (Ri, Gi, Bi) for color correction, which it holds, into the *L*a*b system of color expression, as a result of which lightness information (*Li) is acquired (S1). By `color pattern data for color correction` here is meant color pattern data serving as a standard for use in correcting color shift, and expressed in numerical form. When output by a standard printing device, this data forms a standard color pattern. Similarly, when scanning by a standard scanning device, this data forms color pattern data for use in color correction. The correction coefficients for color shift are values which allow a particular device to approach as close as possible to these standard printing and scanning devices.
This color pattern data for use in color correction is output from the printing unit 44 (S2) to provide test pattern copy 6. In this case it is output without being processed by the color processing unit. The output color pattern is scanned by the scanning unit 41, smoothing is implemented in order to improve the precision with which the color correction is scanned, and this data becomes (R.sub.0 G.sub.0 B.sub.0) (S3).
Next, the data (R.sub.0 G.sub.0 B.sub.0) is converted temporarily into the *L*a*b system in order to obtain lightness information (*L), yielding (*L.sub.0 *a.sub.0 *b.sub.0). The lightness information (*L.sub.0) is converted into lightness information (Li) of the original color pattern data for use in color correction, thus giving (*Li*a.sub.0 *b.sub.0) (S4). In order to correct only the chromaticity, the color correction unit 42 substitutes the lightness data of the color pattern data for use in color correction for the lightness information of the data which has been scanned.
Then, the (*Li*a.sub.0 *b.sub.0) thus acquired is converted back into an RGB signal to yield (R.sub.ch G.sub.ch B.sub.ch) (S5). It is necessary to calculate the correction coefficients in terms of the RGB system because that is the system in which the hardware processes the color data in terms of the RGB system. The correction coefficients are made into 3.times.3 matrices corresponding to the three colors R, G and B, and are represented by the following formula (1). ##EQU1##
If the matrix to be determined is set up in accordance with formula (1), the variables may be represented by the six letters from a to f. The initial value, ranges of variation and resolution of each of these variables (i.e. the units of size of each of the variables, representing values per 0.1 or 0.01) are determined (S6). In FIG. 6, a matrix with values in place of the variables a-f according to formula (2) below is multiplied by (R.sub.ch G.sub.ch B.sub.ch), and (R.sub.tmp G.sub.tmp B.sub.tmp) are calculated (S7). ##EQU2##
Once it has become the correction matrix which serves to minimize color shift, it will be seen that (R.sub.ch G.sub.ch B.sub.ch) represent the pre-correction data, while (R.sub.tmp G.sub.tmp B.sub.tmp) represent the data after correction. The resultant (R.sub.tmp G.sub.tmp B.sub.tmp) are then converted back into *L*a*b coordinates to give (*L.sub.tmp *a.sub.tmp *b.sub.tmp) (S8) The error between this data and the standard color pattern data for use in color correction (*Li*ai*bi) is calculated for each color, and the sum of these errors .DELTA.E determined in accordance with formula (3) (S9). EQU .DELTA.E=[ (*Li-*L.sub.tmp).sup.2 +(ai-a.sub.tmp).sup.2 +(*bi-*b.sub.tmp).sup.2 ].sup.1/2 (3)
This sum is calculated every time the matrix variables a-f are altered within the range of variation (S11), and by repeating steps S7-S10, S11 the total sum within the range of variation of the matrix coefficients is calculated (S10), and the variables a-f of a transformation matrix where the sum of the errors .DELTA.E is smallest are determined. This matrix becomes the correction coefficient of both the scanning unit 41 and the printing unit 44, which is to say it becomes the color correction coefficient during the action of copying.
In the above description the color correction coefficients were calculated by means of the least square. This method requires a great deal of calculation time if the resolution is set too small. For instance, if the range of each of the variables a-f is between -2.0 and +2.0, and if the resolution is set in units of 0.01, the calculations in steps S7-S9 need to be implemented in 401.sup.6 ways, so that much time is expended in calculation. A method of effecting of the calculation in less time has also been proposed.
Firstly, calculations are not effected at a final resolution of 0.01, but rather each of the variables is broken down roughly (e.g. in units of 0.5). The method of the least square is then employed in order to calculate the matrix M11 where the sum of the errors .DELTA.E is smallest, and the matrix M12 where it is second smallest (S12). Resolution is set somewhat more finely (e.g. in units of 0.2) within the range of variables a-f determined by these matrices M11 and M12 (S14). Matrices M21 and M22 where .DELTA.E is respectively smallest and second smallest are calculated again (S7-S12). This is repeated a plurality of times (n times) until the value of each of the variables reaches its smallest resolution (e.g. 0.01), the matrix Mn1 where .DELTA.E is smallest is calculated, and this is adopted as the color correction coefficient (S15). In this way it is possible to obtain the optimum color correction coefficient.
However, in the above conventional examples nine signals are output from the control unit 45 to the color correction unit, and therefore the process of detecting minimum differences in color needs to be executed in all combinations of the nine variables. Consequently, if the number of samples per variable is n, this process must be executed n.sup.9 times. Even if the condition outlined below is applied and the number of variables limited to six as in formula (1) above, the process of detecting minimum differences in color needs to be executed n.sup.6 times.
Condition 1: Achromatic color data is not changed before or after color correction
From Ri=Gi=Bi=R0=G0=B0
m11+m12+m13=1
m21+m22+m23=1
m31+m32+m33=1
Thus there has been a problem in that the number of calculations involved is great, and this requires a large amount of time. There has also been the problem of lengthy processing time which resulted from the fact that the process of calculating the optimum color correction coefficient was implemented by means of software.